package com.example.service.impl;

import com.example.mapper.SpotMapper;
import com.example.pojo.Spot;
import com.example.service.SpotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SpotServiceImpl implements SpotService {
    @Autowired
    private SpotMapper spotMapper;

    @Override
    public Spot getSpotById(Integer id) {
        try {
            return spotMapper.selectById(id);
        }catch (Exception e){
            throw new RuntimeException(e);
        }

    }

    @Override
    public List<Spot> getSpotList() {
        try {
            return spotMapper.selectList(null);
        }catch (Exception e){
            throw new RuntimeException(e);
        }
    }






}
